package com.flycms.module.offline.service;

import java.util.Date;
import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.flycms.module.offline.dao.OfflineActivitySignUpDao;
import com.flycms.module.offline.model.OfflineActivitySignUp;

/**
 *
 * <br/>Copyright 2020
 * <br/>All rights reserved
 * @author 沁言訫語
 * @version 2020年3月2日
 * @Date 2020年3月2日
 */

@Service
public class OfflineActivitySignUpService {

    @Autowired
    OfflineActivitySignUpDao signUpDao;
    
    @Transactional
    public int addOfflineActivitySignUp(OfflineActivitySignUp signUp) throws Exception {
        return signUpDao.addOfflineActivitySignUp(signUp);
    }
    
    @Transactional
    public int editOfflineActivitySignUp(Long id, Integer status, Date updateTime) throws Exception {
        OfflineActivitySignUp signUp = new OfflineActivitySignUp();
        signUp.setId(id);
        signUp.setStatus(status);
        signUp.setUpdateTime(updateTime);
        return signUpDao.editOfflineActivitySignUp(signUp);
    }
    
    public List<OfflineActivitySignUp> getOfflineActivitySignUpList(Long userId, Integer offlineId, Integer status,
            int pageIndex, int pageSize) throws Exception {
        return signUpDao.getOfflineActivitySignUpList(userId, offlineId, status, pageIndex, pageSize);
    }
    
    public int getOfflineActivitySignUpCount(Long userId, Integer offlineId, Integer status) throws Exception {
        return signUpDao.getOfflineActivitySignUpCount(userId, offlineId, status);
    }
    
    public OfflineActivitySignUp queryOfflineActivitySignUpById(Long id) throws Exception {
        return signUpDao.queryOfflineActivitySignUpById(id);
    }
    
}
